package com.bootdo.xiao.suggest;

import java.sql.SQLOutput;

/**
 * @Auther: liuj
 * @Date: 2019/6/17 14:25
 * @Description:建议32：静态变量一定要先声明后赋值
 */
public class Suggest32 {
    public static int i = 1;

    static {
        i = 100;
    }

    public static void main(String[] args){
//        Suggest32 suggest32 = new Suggest32();
//        System.out.println("i = " + suggest32.i);
        System.out.println("i = " + i);
    }
}

class s32{
    public int i = 1;
    public static int j = 1;
    {
        i = 100;
    }

    static {
        j = 100;
    }

    public static void main(String[] args){
        s32 s32 = new s32();
        System.out.println("i = " + s32.i);
        System.out.println("j = " + j);
    }
}